<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Core Plot (iOS): Source/CPTGradient.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="core-plot-logo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Core Plot (iOS)
   
   </div>
   <div id="projectbrief">Cocoa plotting framework for Mac OS X and iOS</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript" src="dynsections.js"></script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Animation&#160;&&#160;Constants</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_c_p_t_gradient_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Source/CPTGradient.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_c_p_t_gradient_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Based on CTGradient (http://blog.oofn.net/2006/01/15/gradients-in-cocoa/)</span>
<a name="l00002"></a>00002 <span class="comment">// CTGradient is in public domain (Thanks Chad Weider!)</span>
<a name="l00003"></a>00003 
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="preprocessor">#import &quot;<a class="code" href="_c_p_t_definitions_8h.html">CPTDefinitions.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#import &lt;Foundation/Foundation.h&gt;</span>
<a name="l00008"></a>00008 
<a name="l00012"></a><a class="code" href="struct___c_p_t_gradient_element.html">00012</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct___c_p_t_gradient_element.html" title="A structure representing one node in a linked list of RGBA colors.">_CPTGradientElement</a> {
<a name="l00013"></a><a class="code" href="struct___c_p_t_gradient_element.html#a92346980894773e902ed8b737e50e146">00013</a>     <a class="code" href="struct___c_p_t_r_g_b_a_color.html" title="RGBA color for gradients.">CPTRGBAColor</a> <a class="code" href="struct___c_p_t_gradient_element.html#a92346980894773e902ed8b737e50e146" title="Color.">color</a>; 
<a name="l00014"></a><a class="code" href="struct___c_p_t_gradient_element.html#ae97439c2ff3301070c9aada737dff1a1">00014</a>     CGFloat <a class="code" href="struct___c_p_t_gradient_element.html#ae97439c2ff3301070c9aada737dff1a1" title="Gradient position (0 ≤ position ≤ 1)">position</a>;   
<a name="l00015"></a>00015 
<a name="l00016"></a><a class="code" href="struct___c_p_t_gradient_element.html#a6c4e88ae0a769422fa36e46f86f4c969">00016</a>     <span class="keyword">struct </span><a class="code" href="struct___c_p_t_gradient_element.html" title="A structure representing one node in a linked list of RGBA colors.">_CPTGradientElement</a> *<a class="code" href="struct___c_p_t_gradient_element.html#a6c4e88ae0a769422fa36e46f86f4c969" title="Pointer to the next CPTGradientElement in the list (last element == NULL)">nextElement</a>; 
<a name="l00017"></a>00017 }
<a name="l00018"></a>00018 <a class="code" href="_c_p_t_gradient_8h.html#aff927dcf5cba534f30dc914c8b4e3e02" title="A structure representing one node in a linked list of RGBA colors.">CPTGradientElement</a>;
<a name="l00019"></a>00019 
<a name="l00023"></a><a class="code" href="_c_p_t_gradient_8h.html#a07bf330417ac01bfaecf1d20bae33619">00023</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="_c_p_t_gradient_8h.html#a07bf330417ac01bfaecf1d20bae33619" title="Enumeration of blending modes.">_CPTBlendingMode</a> {
<a name="l00024"></a><a class="code" href="_c_p_t_gradient_8h.html#a07bf330417ac01bfaecf1d20bae33619a90ac9ca14cac307bc1b8fb21d61d1913">00024</a>     <a class="code" href="_c_p_t_gradient_8h.html#a07bf330417ac01bfaecf1d20bae33619a90ac9ca14cac307bc1b8fb21d61d1913" title="Linear blending mode.">CPTLinearBlendingMode</a>,          
<a name="l00025"></a><a class="code" href="_c_p_t_gradient_8h.html#a07bf330417ac01bfaecf1d20bae33619a5c6e58fafc070c26202927a9d9e90b36">00025</a>     <a class="code" href="_c_p_t_gradient_8h.html#a07bf330417ac01bfaecf1d20bae33619a5c6e58fafc070c26202927a9d9e90b36" title="Chromatic blending mode.">CPTChromaticBlendingMode</a>,       
<a name="l00026"></a><a class="code" href="_c_p_t_gradient_8h.html#a07bf330417ac01bfaecf1d20bae33619aaa47531c3ab634a5ab6dea9c347661a3">00026</a>     <a class="code" href="_c_p_t_gradient_8h.html#a07bf330417ac01bfaecf1d20bae33619aaa47531c3ab634a5ab6dea9c347661a3" title="Inverse chromatic blending mode.">CPTInverseChromaticBlendingMode</a> 
<a name="l00027"></a>00027 }
<a name="l00028"></a>00028 <a class="code" href="_c_p_t_gradient_8h.html#acd9a0a46ddcc0abdb0eaa7d65243ac92" title="Enumeration of blending modes.">CPTGradientBlendingMode</a>;
<a name="l00029"></a>00029 
<a name="l00033"></a><a class="code" href="_c_p_t_gradient_8h.html#accbb52d6ffff88f5632f0333d3960f67">00033</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="_c_p_t_gradient_8h.html#accbb52d6ffff88f5632f0333d3960f67" title="Enumeration of gradient types.">_CPTGradientType</a> {
<a name="l00034"></a><a class="code" href="_c_p_t_gradient_8h.html#accbb52d6ffff88f5632f0333d3960f67ad1726d6fe325a9f43ff0b211e1ac325c">00034</a>     <a class="code" href="_c_p_t_gradient_8h.html#accbb52d6ffff88f5632f0333d3960f67ad1726d6fe325a9f43ff0b211e1ac325c" title="Axial gradient.">CPTGradientTypeAxial</a>, 
<a name="l00035"></a><a class="code" href="_c_p_t_gradient_8h.html#accbb52d6ffff88f5632f0333d3960f67a5cf7d8b13430d8256c52ef339fe53fb7">00035</a>     <a class="code" href="_c_p_t_gradient_8h.html#accbb52d6ffff88f5632f0333d3960f67a5cf7d8b13430d8256c52ef339fe53fb7" title="Radial gradient.">CPTGradientTypeRadial</a> 
<a name="l00036"></a>00036 }
<a name="l00037"></a>00037 <a class="code" href="_c_p_t_gradient_8h.html#ac64907fd1ce21901bf3e510334476402" title="Enumeration of gradient types.">CPTGradientType</a>;
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="keyword">@class</span> <a class="code" href="interface_c_p_t_color_space.html" title="An immutable color space.">CPTColorSpace</a>;
<a name="l00040"></a>00040 <span class="keyword">@class</span> <a class="code" href="interface_c_p_t_color.html" title="An immutable color.">CPTColor</a>;
<a name="l00041"></a>00041 
<a name="l00042"></a><a class="code" href="interface_c_p_t_gradient.html">00042</a> <span class="keyword">@interface </span><a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> : <a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html">NSObject</a>&lt;<a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Protocols/NSCopying_Protocol/Reference/Reference.html">NSCopying</a>, <a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Protocols/NSCoding_Protocol/Reference/Reference.html">NSCoding</a>&gt; {
<a name="l00043"></a>00043     <span class="keyword">@private</span>
<a name="l00044"></a>00044     <a class="code" href="interface_c_p_t_color_space.html" title="An immutable color space.">CPTColorSpace</a> *colorspace;
<a name="l00045"></a>00045     <a class="code" href="struct___c_p_t_gradient_element.html" title="A structure representing one node in a linked list of RGBA colors.">CPTGradientElement</a> *elementList;
<a name="l00046"></a><a class="code" href="interface_c_p_t_gradient.html#af36afb8296d96490bbbf34a1d27d2d81">00046</a>     <a class="code" href="_c_p_t_gradient_8h.html#acd9a0a46ddcc0abdb0eaa7d65243ac92" title="Enumeration of blending modes.">CPTGradientBlendingMode</a> <a class="code" href="interface_c_p_t_gradient.html#af36afb8296d96490bbbf34a1d27d2d81" title="The color blending mode used to create the gradient.">blendingMode</a>;
<a name="l00047"></a>00047     <a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CGFunction/Reference/reference.html#//apple_ref/doc/c_ref/CGFunctionRef.html">CGFunctionRef</a> gradientFunction;
<a name="l00048"></a><a class="code" href="interface_c_p_t_gradient.html#a6e8054d0e90dec26436ea2228e0d0cd2">00048</a>     CGFloat <a class="code" href="interface_c_p_t_gradient.html#a6e8054d0e90dec26436ea2228e0d0cd2" title="The axis angle of an axial gradient, expressed in degrees and measured counterclockwise from the posi...">angle</a>; <span class="comment">// angle in degrees</span>
<a name="l00049"></a><a class="code" href="interface_c_p_t_gradient.html#ab8180ea8284a2369c795a452dfd99246">00049</a>     <a class="code" href="_c_p_t_gradient_8h.html#ac64907fd1ce21901bf3e510334476402" title="Enumeration of gradient types.">CPTGradientType</a> <a class="code" href="interface_c_p_t_gradient.html#ab8180ea8284a2369c795a452dfd99246" title="The gradient type.">gradientType</a>;
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="keyword">@property</span> (nonatomic, readonly, assign) <a class="code" href="_c_p_t_gradient_8h.html#acd9a0a46ddcc0abdb0eaa7d65243ac92" title="Enumeration of blending modes.">CPTGradientBlendingMode</a> blendingMode;
<a name="l00053"></a>00053 <span class="keyword">@property</span> (nonatomic, readwrite, assign) CGFloat angle;
<a name="l00054"></a>00054 <span class="keyword">@property</span> (nonatomic, readwrite, assign) <a class="code" href="_c_p_t_gradient_8h.html#ac64907fd1ce21901bf3e510334476402" title="Enumeration of gradient types.">CPTGradientType</a> gradientType;
<a name="l00055"></a>00055 
<a name="l00058"></a>00058 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)gradientWithBeginningColor:(<a class="code" href="interface_c_p_t_color.html" title="An immutable color.">CPTColor</a> *)begin endingColor:(<a class="code" href="interface_c_p_t_color.html" title="An immutable color.">CPTColor</a> *)end;
<a name="l00059"></a>00059 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)gradientWithBeginningColor:(<a class="code" href="interface_c_p_t_color.html" title="An immutable color.">CPTColor</a> *)begin endingColor:(<a class="code" href="interface_c_p_t_color.html" title="An immutable color.">CPTColor</a> *)end beginningPosition:(CGFloat)beginningPosition endingPosition:(CGFloat)endingPosition;
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)aquaSelectedGradient;
<a name="l00062"></a>00062 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)aquaNormalGradient;
<a name="l00063"></a>00063 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)aquaPressedGradient;
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)unifiedSelectedGradient;
<a name="l00066"></a>00066 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)unifiedNormalGradient;
<a name="l00067"></a>00067 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)unifiedPressedGradient;
<a name="l00068"></a>00068 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)unifiedDarkGradient;
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)sourceListSelectedGradient;
<a name="l00071"></a>00071 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)sourceListUnselectedGradient;
<a name="l00072"></a>00072 
<a name="l00073"></a>00073 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)rainbowGradient;
<a name="l00074"></a>00074 +(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)hydrogenSpectrumGradient;
<a name="l00076"></a>00076 
<a name="l00079"></a>00079 -(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)gradientWithAlphaComponent:(CGFloat)alpha;
<a name="l00080"></a>00080 -(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)gradientWithBlendingMode:(<a class="code" href="_c_p_t_gradient_8h.html#acd9a0a46ddcc0abdb0eaa7d65243ac92" title="Enumeration of blending modes.">CPTGradientBlendingMode</a>)mode;
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 -(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)addColorStop:(<a class="code" href="interface_c_p_t_color.html" title="An immutable color.">CPTColor</a> *)color atPosition:(CGFloat)position; <span class="comment">// positions given relative to [0,1]</span>
<a name="l00083"></a>00083 -(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)removeColorStopAtIndex:(<a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html">NSUInteger</a>)index;
<a name="l00084"></a>00084 -(<a class="code" href="interface_c_p_t_gradient.html" title="Draws color gradient fills.">CPTGradient</a> *)removeColorStopAtPosition:(CGFloat)position;
<a name="l00086"></a>00086 
<a name="l00089"></a>00089 -(<a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CGColor/Reference/reference.html#//apple_ref/doc/c_ref/CGColorRef.html">CGColorRef</a>)newColorStopAtIndex:(<a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html">NSUInteger</a>)index;
<a name="l00090"></a>00090 -(<a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CGColor/Reference/reference.html#//apple_ref/doc/c_ref/CGColorRef.html">CGColorRef</a>)newColorAtPosition:(CGFloat)position;
<a name="l00092"></a>00092 
<a name="l00095"></a>00095 -(void)drawSwatchInRect:(<a class="codeRef" href="http://developer.apple.com/iPhone/library/documentation/GraphicsImaging/Reference/CGGeometry/Reference/reference.html#//apple_ref/doc/c_ref/CGRect.html">CGRect</a>)rect inContext:(<a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CGContext/Reference/reference.html#//apple_ref/doc/c_ref/CGContextRef.html">CGContextRef</a>)context;
<a name="l00096"></a>00096 -(void)fillRect:(<a class="codeRef" href="http://developer.apple.com/iPhone/library/documentation/GraphicsImaging/Reference/CGGeometry/Reference/reference.html#//apple_ref/doc/c_ref/CGRect.html">CGRect</a>)rect inContext:(<a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CGContext/Reference/reference.html#//apple_ref/doc/c_ref/CGContextRef.html">CGContextRef</a>)context;
<a name="l00097"></a>00097 -(void)fillPathInContext:(<a class="codeRef" href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Reference/CGContext/Reference/reference.html#//apple_ref/doc/c_ref/CGContextRef.html">CGContextRef</a>)context;
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 <span class="keyword">@end</span>
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_c_p_t_gradient_8h.html">CPTGradient.h</a>      </li>

    <li class="footer">Generated by <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a></li>
   </ul>
 </div>


</body>
</html>
